<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script>
        class Human {
            xingzou = 'leg'
            chifan = 'mouse'
            shenghuo(){
                console.log(`大家用${this.xingzou}行走，用${this.chifan}吃饭`)
            }
            constructor(name,age){
                this.name = name
                this.age = age
            }
        }
        var h1 = new Human('cai',23)
        h1.shenghuo()
        console.log(h1)

        class Kids extends Human{
            constructor(name,age,parent){
                super(name,age)
                this.parent = parent 
            }
            WhoISYourParents(){
                console.log(`我的父母是${this.parent}`)
            }
        }
        var k1 = new Kids('caikid',2,'caipeiyan')
        k1.WhoISYourParents()
        console.log(k1)
    </script>
</head>


<body>
    
</body>
</html>